package com.zhang.sh.controller;


import com.zhang.sh.pojo.User;
import com.zhang.sh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author tps
 * @since 2021-01-02
 */
@RestController
@RequestMapping("user")
public class UserController {

        @Autowired
        private UserService userService;

        @GetMapping("/{id}")
        public User queryById(@PathVariable("id") String username) {
            return userService.queryById(username);
        }
}
